(1) Field of the Invention
The present invention is related to the field of device drivers for networking devices, more specifically, the present invention is a method and an apparatus for reducing interrupt overhead in networking device drivers.
(2) Related Art
Computer systems capable of transmitting and receiving data through a network typically have network hardware interrupts to support network data transmission and reception. Traditionally, network hardware interrupts have higher priority than most other hardware interrupts.
While a device driver activated by a given hardware interrupt is occupied in processing data on a computer system, no other device drivers having an interrupt level below the running device driver may begin its execution. Some hardware devices such as an Asynchronous Transfer Method (ATM) device may cause a plurality of hardware interrupts in a very short period of time. The plurality of hardware interrupts may allow a device driver associated with the ATM device to monopolize central processing unit (CPU) time. Such monopolization may adversely affect normal processing of the computer system due to delayed processing of lower level interrupt requests. An exemplary time line illustrating a hardware interrupt being delayed by excessive processing of a previous hardware interrupt is illustrated in FIG. 1.
FIG. 1 illustrates a timing diagram with an ATM device and an Ethernet device both causing hardware interrupts. While a computer system is executing on time a line 100 at time A, an ATM device 102 asserts a hardware interrupt which is serviced. While the hardware interrupt handler is de-queuing packets off of the ATM device 102, an Ethernet 104 asserts a hardware interrupt at time B. However, because the hardware interrupt asserted by the ATM 102 is already accepted, the Ethernet 104's request to initiate a hardware interrupt is denied. At time C, the ATM 102's hardware interrupt has completed de-queuing packets off of the ATM device 102 and the process time is freed up. The Ethernet 104's hardware interrupt may finally begin processing.
To compound the problem of undue delay of low level processing, ATM devices perform all of their processing within a CPU's interrupt context. FIG. 2 illustrates an exemplary task initiated by a single hardware interrupt caused by an ATM device. Once a packet arrives on the ATM device, an interrupt is asserted by the ATM device and an ATM device driver 110 de-queues packets off the ATM device and determines that the packet is an Internet Protocol (IP) packet. The packet is then transported to the IP layer 112 which determines that the packet is a Transport Control Protocol (TCP) packet. The packet is then forwarded to the TCP layer 114. The TCP layer 114 determines that the packet is a TCP layer 114 acknowledge packet (i.e. acknowledgment to the TCP that the packet which the TCP forwarded to the ATM device has been successfully transmitted to its destination.) The TCP layer 114 may then transmit a new packet and forwards a new packet to the IP layer 112. The IP layer 112 forwards the packet to the ATM device driver 110. The ATM device driver 110 transmits the packet to the ATM device.
As was illustrated in FIG. 2, device drivers for networking equipment such as an ATM device typically perform all of their processing within a CPU's interrupt context. While running a device driver associated with the ATM device, the CPU is prohibited from servicing lower level interrupt tasks resulting in reduced overall system performance. Thus, it is desirable to have a method and an apparatus for high level processing to be performed at a lower interrupt level to allow other interrupts to be serviced by the CPU.